package com.wesh.home.controller;

import com.wesh.home.model.Tender;
import com.wesh.home.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/_search")
public class SearchController {

    @Autowired
    SearchService searchService;

    @GetMapping("/searchAll")
    public Page<Tender> searchAll(String keyword, int page, int size){
        return searchService.search(keyword, page, size);
    }

}
